<!--#include virtual="/Common/Config.asp" -->
<!--#include virtual="/Common/conn.asp" -->
<!--#include virtual="/2010admin/Check_IsLogin.asp" -->
<!--#include virtual="/Common/Function.asp" -->
<%
'排序名称
Dim Sort_Name
Dim Sort_Table_Name,Sort_Title,Key_ID
'	置项表				标题	     主键

'修改开始
Sort_Name = "分类信息"
Sort_Table_Name = "Person_Info"
Sort_Title		= "PI_Title"
Key_ID			= "PI_ID"
Back_URL		= "Person_Info_Query.asp"
'结束
If Request.ServerVariables ("Request_Method")="POST" Then
	Sort_Deep = reform("Sort_Deep")
	Sort_Type = reform("Sort_Type")
End If 
If Request.ServerVariables ("Request_Method")="POST" And reform("action")="sort" Then

	'禁止从网站外部提交数据
	Call Deny_OutSiteSubit()

	Desc_ID_Str = reform("RightList")
	
	If Desc_ID_Str = "" Then 	AlertBox "请选择菜单项！",Back_URL

	Desc_ID_Arr = Split(Desc_ID_Str,",")
	j=1
	For i =0 To UBound(Desc_ID_Arr)
		conn.execute("UPDATE Info_Sort_Table SET Sort_Order = "& j  &" WHERE ID="&Trim(Desc_ID_Arr(i)))
		j = j + 1
	Next
	AlertBox "排序成功！",Back_URL
End If

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="/2010admin/css/default.css" type="text/css" rel="stylesheet">
<title><%=web_title%></title>
<script language="javascript" src="/js/jquery.js"></script>
<script language="javascript" src="/2010admin/js/function.js"></script>
</head>
<body>
<table border="0" width="100%" cellSpacing="0" cellPadding="0">
  <tr>
    <td width="100%" height="5"></td>
  </tr>
  <tr>
    <td width="100%" align="center">
      <table border="0" width="98%" cellSpacing="0" cellPadding="0">
        <tr>
          <td width="*" align="center" valign="top">
            <table border="0" width="100%" cellSpacing="0" cellPadding="0" class="lrbtline">
              <tr>
                <td width="100%" height="25" class="tbtop">管理导航</td>
              </tr>
              <tr>
                <td width="100%" align="center">&nbsp;</td>
              </tr>
            </table>
            <table border="0" width="100%" cellSpacing="0" cellPadding="0">
              <tr>
                <td width="100%" height="5"></td>
              </tr>
            </table>
            <table border="0" width="100%" cellSpacing="0" cellPadding="0" class="lrbtline">
              <tr>
                <td width="100%" height="25" class="tbtop">排序类型</td>
              </tr>
              <tr>
                <td width="100%" align="center">
                  <table border="0" width="98%" cellSpacing="0" cellPadding="0">
                    <tr>
                      <td width="100%" height="5"></td>
                    </tr>
                  </table>
                  <table border="0" width="98%" cellSpacing="0" cellPadding="0" class="tablesh">
                  <form name="form2" method="post" action="" >
                    <tr>
                      <td height="25" width="10%">指定要排序级别</td>
                      <td  width="*">
					  排序分类：
					  <% Selected_BySql "Sort_Type","SELECT Sort_Sub_ID,Sort_Sub_Name FROM uvw_Sort_Type WHERE Sort_Name='"&Sort_Name&"'ORDER BY Sort_Sub_Order ASC","",Sort_Type %>
					  <input type="submit" name="submit1" value="查找" class="button" >
					  <input type="hidden" name="action" value="search"></td>
                    </tr>
                  </form>
                  </table>
                  <table border="0" width="98%" cellSpacing="0" cellPadding="0">
                    <tr>
                      <td width="100%" height="5"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table border="0" width="100%" cellSpacing="0" cellPadding="0" class="lrbtline">
              <tr>
                <td width="100%" height="25" class="tbtop">排序</td>
              </tr>
              <tr>
                <td width="100%" align="center">
                  <table border="0" width="98%" cellSpacing="0" cellPadding="0">
                    <tr>
                      <td width="100%" height="5"></td>
                    </tr>
                  </table>
                  <table border="0" width="98%" cellSpacing="0" cellPadding="0" class="tablesh">
                  <form name="form" method="post" action="" onSubmit="return checkform();">
                    <tr>
                      <td height="25">&nbsp;</td>
                      <td>原顺序</td>
                      <td align="center">&nbsp;</td>
                      <td colspan="2">新顺序</td>
                    </tr>
                    <tr>
                      <td width="39" height="25">&nbsp;</td>
                      <td width="200"><%=reform("Sort_Deep")%>
					  <select name="LeftList" size=10 multiple style="width:200;">
					   <%
					   If Request.ServerVariables ("Request_Method")="POST" And reform("action")="search" Then
							Sort_Type = reform("Sort_Type")
							writebr Sort_Type

							Sql = "SELECT a.ID,b."&Sort_Title&" FROM Info_Sort_Table a INNER JOIN "&Sort_Table_Name&" b ON a.Info_ID = b."&Key_ID&"  WHERE   a.Sort_Sub_ID="&Sort_Type&" ORDER BY a.Sort_Order ASC"
							writebr sql
							

							'Sort_Table_Name,Sort_Title,Key_ID

							array_List = GetRsRows(Sql)
							If IsArray(array_List) Then 

							For i=0 To UBound(array_List,2)

					   %>
						<option value="<%=array_List(0,i)%>"><%=array_List(1,i)%></option>
					   <%
						   Next						  
						   End If 
						   Set array_List = Nothing 
					   End If 
					   %>
					  </select>
					  </td>
                    <td width="82" align="center"><p>
                     <input type="button" name="btnAdd" onClick="if(document.form.LeftList.value!=''){AddToRight();}" value=" >> ">
                    </p>
                      <p>
                       <input type="button" name="btnDel" onClick="if(document.form.RightList.value!=''){DelFromRight();}" value=" << ">         
                            </p>
					   <p>
                       <input type="button" name="btnDel" onClick="if(document.form.LeftList.value!=''){Del();}" value="删除">         
                       </p>								</td>
                      <td width="209"><select name="RightList" id="RightList" size="10" multiple style="width:200;">
                    </select>                        </td>
                    <td width="683"><input type="button" name="btnAdd2" onClick="changepos(RightList,-1)" value="上移">
                      <br>
                      <input type="button" name="btnDel2" onClick="changepos(RightList,1)" value="下移"></td>
                    </tr>
                    <tr>
                      <td height="25">&nbsp;</td>
                      <td>&nbsp;</td>
                    <td><input type="submit" name="submit1" value="提交" class="button" ></td>
                      <td colspan="2">&nbsp;<input type="hidden" name="action" value="sort"></td>
                    </tr>
                  </form>
                  </table>
                  <table border="0" width="98%" cellSpacing="0" cellPadding="0">
                    <tr>
                      <td width="100%" height="5"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td width="100%" height="5"></td>
  </tr>
</table>
</body>
</html>
<%
Call conn_close()
%>




